import "package:ct_pa_majordomo/pages/check_in_detail/unlock_permission_manage/tab_pane.dart";
import "package:ct_pa_majordomo/widgets/normal_scaffold/index.dart";
import "package:flutter/cupertino.dart";
import "package:flutter/material.dart";

class UnlockPermissionManage extends StatefulWidget {
  const UnlockPermissionManage({super.key});

  @override
  State<StatefulWidget> createState() => _UnlockPermissionManageState();

}

class _UnlockPermissionManageState extends State<UnlockPermissionManage> {

  List _tabs = ["钥匙", "密码", "指纹", "人脸"];


  @override
  Widget build(BuildContext context) {
    return NormalScaffold(
      title: "开门权限管理",
      actions: [
        TextButton(
          onPressed: () {},
          child: const Text("全部删除", style: TextStyle(color: Colors.white),)
        ),
      ],
      child: DefaultTabController(
        length: _tabs.length,
        child: Column(
          children: [
            Container(
              height: 48,
              decoration: BoxDecoration(
                  color: Colors.white
              ),
              child: TabBar(
                tabs: List.generate(_tabs.length, (index) {
                  return Tab(text: _tabs[index],);
                }),
              ),
            ),
            Container(
              height: MediaQuery.of(context).size.height - 146,
              child: TabBarView(
                children: [
                  TabPane(type: KeyType.key, lockId: 12),
                  TabPane(type: KeyType.password, lockId: 12),
                  TabPane(type: KeyType.fingerprint, lockId: 12),
                  TabPane(type: KeyType.face, lockId: 12),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }

}